<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>
    </title>
</head>
<body>
    <h1> sjfosj </h1>
    <select id="select">
        <option value="option1">Option 1</option>
        <option value="option2">Option 2</option>
        <option value="option3">Option 3</option>
    </select>
    <p>laoliu</p>

    <script>
        const selectElement = document.getElementById('select');
        const h1Element = document.querySelector('h1');

        selectElement.addEventListener('change', function() {
            const selectedValue = this.value;
            if (selectedValue === 'option1') {
                h1Element.textContent = '你选择了 Option 1';
            } else if (selectedValue === 'option2') {
                h1Element.textContent = '你选择了 Option 2';
            } else if (selectedValue === 'option3') {
                h1Element.textContent = '你选择了 Option 3';
            }
        });
    </script>
</body>
</html>